﻿@{
    ViewBag.Title = "我的订单";
    Layout = "~/Views/Shared/_MobileLayout.cshtml";
    var orderList = ViewBag.OrderList as List<LPY.LeHealth.DTO.Order>;
}

<ol class="breadcrumb">
    <li><a href="@Url.Action("UserCenter","Mobile")"><i class="fa fa-user"></i> 用户中心</a></li>
    <li><a href="@Url.Action("OrderManager","Mobile")">我的订单</a></li>
</ol>

<div class="container">
    <div class="row" style="margin-top:-10px;">
        <!--按钮组-->
        <div class="btn-group btn-group-justified">
            <div class="btn-group">
                <a href="@Url.Action("OrderManager","Mobile",new{state=0})" class="btn btn-info">
                    <b>待付款 </b><span class="badge">@ViewBag.PayCount</span>
                </a>
            </div>
            <div class="btn-group">
                <a href="@Url.Action("OrderManager","Mobile",new{state=1})" class="btn btn-info">
                    <b>待预约 </b><span class="badge">@ViewBag.AppointCount</span>
                </a>
            </div>
            <div class="btn-group">
                <a href="@Url.Action("OrderManager","Mobile",new{state=2})" class="btn btn-info">
                    <b>待体检 </b><span class="badge">@ViewBag.PhysicalCount</span>
                </a>
            </div>
        </div>
    </div>
</div>
<!--订单类表-->
@for (int i = 0; i < orderList.Count; i++)
{
    <div class="panel panel-default" style="padding-bottom:0px;margin-top:10px;">
        <div class="panel-heading"><b>订单编号：@orderList[i].Ordercode</b></div>
        <div class="panel-body" style="padding-bottom:0px;">
            <p>订单价格：￥@Math.Round(orderList[i].SumPrice,2)</p>
            <p>创建时间：@orderList[i].CreateDate</p>
            @switch (orderList[i].State)
            {
                case 0:
                    <p>订单状态：<span class="label label-success">待支付</span></p>
                    <p class="pull-right">
                        <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="@Url.Action("Pay", "Mobile", new { id = orderList[i].Id })">去付款</a>
                    </p>
                    break;
                    case 1:
                    <p>订单状态：<span class="label label-success">待预约</span></p>
            <p class="pull-right">
                <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="@Url.Action("Appointment", "Mobile", new { id = orderList[i].Id })">去预约</a>
            </p>
                    break;
                                        case 2:
                    <p>订单状态：<span class="label label-success">待体检</span></p>
                    break;
                default:
                                    case 3:
                    <p>订单状态：<span class="label label-success">体检完成</span></p>
                    break;
            }
            <p class="pull-right">
                <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="@Url.Action("OrderDetails", "Mobile", new { id = orderList[i].Id })">订单明细</a>
            </p>
        </div>
    </div>
}

@*<div class="panel panel-default" style="padding-bottom:0px;margin-top:10px;">
    <div class="panel-heading"><b>订单编号：11231-123-123-123</b></div>
    <div class="panel-body" style="padding-bottom:0px;">
        <p>订单价格：￥200</p>
        <p>创建时间：2016-10-1 20：30</p>
        <p>订单状态：<span class="label label-success">待支付</span></p>
        <p class="pull-right">
            <a class="btn btn-primary btn-sm" href="#">去付款</a>
            <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="#">去预约</a>
            <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="#">订单详情</a>
        </p>
    </div>
</div>*@